package com.aaa.controller;

import com.aaa.entity.MyPage;

import com.aaa.entity.TbUser;
import com.aaa.service.TbUserService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("tuser")
public class TbUserController {

    // controller -->service  -->dao
    @Autowired
    private TbUserService tbUserService;

    @GetMapping("query")
    @ResponseBody
    public PageInfo queryByPage(MyPage page){
       return tbUserService.queryByPage(page);
    }




    @GetMapping("query1")
    @ResponseBody
    public List<TbUser> findAll(){


        return tbUserService.findAll();
    }
}
